<%= form_for(@post) do |f| %>
  <% if @post.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>

      <ul>
      <% @post.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </div>
  <div class="field">
    <%= f.label :post %><br />
    <%= f.text_area :post %>
  </div>
  <div class="field">
    <%= f.label :user_id %><br />
	<% users_array = User.all.map { |u| [u.username, u.id] } %>
	<%= f.select(:user_id, users_array)%>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
